<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top"><span style="display: none;">加载中...</span> <span>设置新登录密码</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="./securityCenter.html" class="iconfont back"></a>
    </header>


    <div data-v-23f07895="" class="main" s="[object Object]">
        <input type="hidden" name="uid" id="uid" value="{$arr.userid}">
        <table data-v-23f07895="">
            <tbody data-v-23f07895="">
            <tr data-v-23f07895="">
                <td data-v-23f07895="" style="width: 180px">新&nbsp;&nbsp;登&nbsp;&nbsp;录&nbsp;&nbsp;密&nbsp;码：</td>
                <td data-v-23f07895="">
                    <input data-v-23f07895="" id="pass1" type="password" tag="登录密码" placeholder="请输入新登录密码" class="va47" name="Password">
                </td>
            </tr>
            <tr data-v-23f07895="">
                <td data-v-23f07895="">确认新登录密码：</td>
                <td data-v-23f07895="">
                    <input data-v-23f07895="" id="pass2" type="password" tag="确认密码" placeholder="请再次输入新登录密码" class="va47" name="checkPassword">
                </td>
            </tr>
            <tr data-v-23f07895=""></tr>
            </tbody>
        </table>
        <div data-v-baaae126="" class="loginBtn BTN"><a data-v-baaae126="" onclick="sav()">确定</a></div>
    </div>
</div>
<!--密码不为空-->
<div id="pass11" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">-新密码不能为空-</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<!--密码不为空-->
<div id="pass22" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">-确认新密码不能为空-</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<!--两次输入的新密码不一致-->
<div id="pass33" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">-两次输入的新密码不一致，请重新输入-</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
<!--新密码设置成功-->
<div id="pass44" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">-新密码设置成功-</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script>
    $(".layermbtn").click(function(){
        $(this).parents(".layermbox").hide();
    });

    function sav(){
        var id = $("#uid").val();
        var pass1 = $("#pass1").val();
        var pass2 = $("#pass2").val();
        if(pass1==""){
            $("#pass11").show();
            return false;
        }
        if(pass2==""){
            $("#pass22").show();
            return false;
        }
        if(pass2 != pass1){
            $("#pass33").show();
            return false;
        }
        $.ajax({
            type: "POST",
            url: "{:U('Users/setPwd')}",
            data: {'id': id,'pass': pass2},
            success: function (dat) {
                if (dat == 1) {
                    $("#pass44").show();
                }
            }
        });

    }
    $("#pass44").click(function(){
        window.location.href="/Users/securityCenter";
    })
</script>